package com.yohann.order_service.client;

import com.yohann.order_service.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * <p>
 * 用户服务代理
 * </p>
 *
 * @author Yohann
 * @since 2020/11/28 23:35
 */
@Component
@FeignClient("user-service")
public interface UserClient {
    /**
     * 通过id获取用户信息
     *
     * @param id 用户id
     * @return 用户信息
     */
    @GetMapping("/user_service/getUser/{id}")
    User getUser(@PathVariable("id") int id);
}